package com.example.springbootmybatis.mapper;


import com.example.springbootmybatis.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
//把UserMapper 接口生成对象放入spring容器 IOC（控制反转） 反射和注解
@Mapper
public interface UserMapper {

    //登录
//    @Select("select * from userTable where username=#{username} and password=#{password} ")
    public UserEntity login(UserEntity userEntity);
//获取所有用户
    public List<UserEntity> getAllUsers();


    public List<UserEntity> getUsersByName(String name);

    //只要涉及到改变数据那么数据库操作的返回值都是1 操作成功，0 没有改变  delete update insert
    public int updateUserByID(UserEntity entity);
    //注册新用户
    public int insertUser(UserEntity entity);
//     删除用户
    public int deleteUserByid (Integer uid);

    public int checkIsExist(String username);

    public int deleteUserByIds(List<Integer> ids);


}
